<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="utf-8">
    <title>{$goods.goods_name}-{$tpshop_config['shop_info_store_title']}</title>
    <meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
    <meta name="description" content="{$tpshop_config['shop_info_store_desc']}" /></head>
  
  <body>
    <!--------头部开始-------------->
    <include file="Public/header" />
    <!--------头部结束-------------->
    <link rel="stylesheet" href="/Template/pc/kty/Static/css/page.css" type="text/css">
    <link rel="stylesheet" href="/Template/pc/kty/Static/css/jqzoom.css" type="text/css">
    <link rel="stylesheet" href="/Template/pc/kty/Static/css/location.css" type="text/css">
    <!-- 收货地址，物流运费 -->
    <div class="layout">
      <div class="pathme1">
        <a href="{:U('Home/Goods/goodsList')}">
          <span>全部分类</span></a>>
        <foreach name="navigate_goods" key="k" item="v">
          <a href="{:U('/Home/Goods/goodsList',array('id'=>$k))}">
            <span>{$v}</span></a>></foreach>
        <span>{$goods.goods_name}</span></div>
        <form name="buy_goods_form" method="post" id="buy_goods_form">
          <div class="goodsbuy">
            <div class="gdimg floatl spec-preview" id="preview">
              <span class="jqzoom">
                <img jqimg="{$goods.goods_id|goods_thum_images=800,800}" src="{$goods.goods_id|goods_thum_images=470,470}" style="width: 470px;height: 470px;border: solid 1px #eee" alt="" /></span>
            </div>
            <div class="gdsimg floatl">
              <h3>{$goods.goods_name}</h3>
              <p>{$flash_sale['description']}</p>
              <div class="pricegd">
                <div class="pricel">
                  <h1>￥{$goods.shop_price}</h1>
                  <span>原价￥{$goods.market_price}</span></div>
                <div class="jifena">送积分
                  <i>{$goods.give_integral}</i>分</div>
              </div>
              <div class="yfkd kuaidi_selector">
                <span style="margin-left:10px;">运费</span>
                <span style="margin-left: 40px;margin-right: 5px">上海</span>至
                <span class="kuaidi_to" style="margin-left: 5px;"></span>
                <div onclick="$(this).parent().removeClass('hover')" class="close"></div>
                <i class="iconxia"></i>快递：
                <span class="kuaidi_fee">0</span></div>
              <div class="yhc">
                <div class="ysc">已售出：
                  <span>{$goods.sales_sum}</span>份</div>
                <div class="ljpj">累计评价：
                  <span>{$goods.comment_count}</span></div>
                <!-- JiaThis Button BEGIN 分享商品链接-->
                <a class="fxa floatl jiathis jiathis_txt" href="http://www.jiathis.com/share">
                  <img class="floatl" style="margin-top: 2px" src="/Template/pc/kty/Static/images/goods_info/fxa.png" alt="" />
                  <span class="floatl">分享</span>
                </a>
                <script>
                    var jiathis_config = {
                        url:"http://{$_SERVER[HTTP_HOST]}/index.php?m=Home&c=Goods&a=goodsInfo&id={$_GET[id]}",
                        pic:"http://{$_SERVER[HTTP_HOST]}{$goods[goods_id]|goods_thum_images=400,400}",
                    }
                    var is_distribut = getCookie('is_distribut');
                    var user_id = getCookie('user_id');
                    // 如果已经登录了, 并且是分销商
                    if(parseInt(is_distribut) == 1 && parseInt(user_id) > 0)
                    {
                        jiathis_config.url = jiathis_config.url + "&first_leader="+user_id;
                    }
                    //alert(jiathis_config.url);
                </script>
                <script type="text/javascript" src="http://v3.jiathis.com/code_mini/jia.js" charset="utf-8"></script>
                <!-- JiaThis Button END 分享商品链接-->
              </div>
              <div class="buynum floatl">
                <h4 class="floatl">购买数量：</h4>
                <div class="numm floatl">
                  <div class="numk floatl">
                    <input type="text" value="1" name="goods_num" id="goods_num" readonly/></div>
                  <div class="jia floatl">+</div>
                  <div class="jian floatl">-</div></div>
              </div>
              <div class="gmc floatl">
                <a href="javascript:;" onclick="AjaxAddCart({$goods.goods_id},1,1);">
                  <div class="ljgm floatl">立即购买</div></a>
                <a href="javascript:;" onclick="AjaxAddCart({$goods.goods_id},1,0);">
                  <div class="jrgwc floatl">加入购物车</div></a>
              </div>
            </div>
            <input type="hidden" name="goods_id" value="{$goods.goods_id}" />
            <style>.items ul li{ float: left; }</style>
            <div class="spec-scroll smimg  ">
              <div class="items">
                <ul>
                  <volist name="goods_images_list" id="v" offset="0" length='4'>
                    <li>
                      <a href="javascript:;">
                        <img bimg="{$v|get_sub_images=$v[goods_id],800,800}" src="{$v|get_sub_images=$v[goods_id],470,470}" onmousemove="preview(this);" style="margin-left: 10px;margin-right: 3px;width: 105px;height: 105px;border: solid 1px #eee" alt=""></a>
                      </li>
                    </volist>
                </ul>
              </div>
            </div>
          </div>
      </form>
      <div class="xqph floatl">
        <div class="xqphl floatl">
          <div class="phb floatl">
            <div class="phbt">
              <h3>销量排行榜</h3></div>
            <tpshop sql="select * from `__PREFIX__goods` where is_on_sale = 1 order by sales_sum desc limit 6" item="v" key="k">
              <div class="phk floatl">
                <a href="{:U('Home/Goods/goodsInfo',array('id'=>$v[goods_id]))}">
                  <img src="{$v.goods_id|goods_thum_images=50,50}" alt="" style="margin-left:4px;margin-top: 15px;float: left" /></a>
                <a href="{:U('Home/Goods/goodsInfo',array('id'=>$v[goods_id]))}">
                  <p>{$v.goods_name|getSubstr=0,14}</p>
                </a>
                <h3>￥{$v.shop_price}</h3>
                <h4>销量：
                  <span>{$v.sales_sum}</span></h4>
              </div>
            </tpshop>
          </div>
          <div class="ewm11 floatl">
            <img src="/Template/pc/kty/Static/images/goods_info/wx160160.png" style="margin-left: 25px;margin-top: 22px;" alt="" />
            <p>微信扫描二维码关注
              <br/>开太鱼微信公众号</p></div>
          <div class="phb floatl" style="margin-top: 17px;">
            <div class="phbt">
              <h3>推荐产品</h3></div>
            <tpshop sql="select * from `__PREFIX__goods` where is_on_sale = 1 and is_recommend = 1 order by goods_id desc limit 6" item="v" key="k">
              <div class="phk floatl">
                <a href="{:U('Home/Goods/goodsInfo',array('id'=>$v[goods_id]))}">
                  <img src="{$v.goods_id|goods_thum_images=50,50}" alt="" style="margin-left:4px;margin-top: 15px;float: left" /></a>
                <a href="{:U('Home/Goods/goodsInfo',array('id'=>$v[goods_id]))}">
                  <p>{$v.goods_name|getSubstr=0,14}</p>
                </a>
                <h3>￥{$v.shop_price}</h3>
                <h4>销量：
                  <span>{$v.sales_sum}</span></h4>
              </div>
            </tpshop>
          </div>
        </div>
        <script>
              $(function(){
                  $(".xqk").click(function(){
                      $(".xqtitle").removeClass("pjt1")
                      $(".xqtitle").removeClass("pqt1")
                      $(".xqtitle").addClass("pjt1")
                      $(".xqnr").show()
                      $(".pjnr").hide()
                  })

                  $(".pjk").click(function(){
                      $(".xqtitle").removeClass("pjt1")
                      $(".xqtitle").removeClass("pqt1")
                      $(".xqtitle").addClass("pqt1")
                      $(".pjnr").show()
                      $(".xqnr").hide()
                  })
              })
          </script>
        <div class="spxq">
          <div class="xqtitle pjt1 ">
            <div class="xqk"></div>
            <div class="pjk"></div>
          </div>
          <div class="xqnr" style="display: block;margin-left: 260px;margin-top: 15px">{$goods.goods_content|htmlspecialchars_decode}</div>
          <div class="pjnr" id="ajax_comment_return" style="display:none;margin-left: 260px;">
            <!-- ajax评价 --></div>
        </div>
    </div>
    </div>
    <div class="ftmg"></div>
    <!--------收货地址，物流运费-开始-------------->
    <script src="__STATIC__/js/location.js"></script>
    <!--------收货地址，物流运费--结束-------------->

    <!--------footer-开始-------------->
    <include file="Public/footer" />
    <!--------footer-结束-------------->
    <script type="text/javascript">$(document).ready(function() {
        commentType = 1; // 评论类型
        ajaxComment(1, 1); // ajax 加载评价列表
      });

      // 好评差评 切换
      $(".eval-cen-le a").click(function() {
        $(".eval-cen-le li").removeClass('curres');
        $(this).parent().addClass('curres');
        commentType = $(this).data('t'); // 评价类型   好评 中评  差评
        ajaxComment(commentType, 1);
      });

      // 用ajax分页显示评论
      function ajaxComment(commentType, page) {
        $.ajax({
          type: "GET",
          url: "/index.php?m=Home&c=Goods&a=ajaxComment&goods_id={$goods['goods_id']}&commentType=" + commentType + "&p=" + page,
          //+tab,
          success: function(data) {
            $("#ajax_comment_return").html('');
            $("#ajax_comment_return").append(data);
          }
        });
      }

      var spnum = 0

      $("#goods_num").blur(function() {
        if (spnum > 0) {
          spnum = $("#goods_num").val();
        } else {
          spnum = 0;
        }
      })

      $(".jia").click(function() {
        spnum++
        if (spnum > 0) {
          $("#goods_num").val("");
          $("#goods_num").val(spnum);
        } else {
          spnum = 0;
        }

      })

      $(".jian").click(function() {
        if (spnum > 0) {
          spnum--;
          $("#goods_num").val("");
          $("#goods_num").val(spnum);
        } else {
          spnum = 0;
          $("#goods_num").val("");
          $("#goods_num").val(spnum);
        }
      })</script>
  </body>

</html>